package com.yb.bluetooth.util

import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import com.yb.bluetooth.entity.BtMessage

/**
 * Created by zyb
 * Date 2022/2/8 17:51
 * Desc
 */

object LiveBus {

    private val liveData = MutableLiveData<BtMessage>()

    fun post(item: BtMessage) {
        liveData.postValue(item)
    }

    fun observe(owner: LifecycleOwner, observer: Observer<BtMessage>) {
        liveData.observe(owner, observer)
    }
}